<?php
class LESSPHP_Writer_Simple implements LESSPHP_Writer_Interface{
	
	public function write(SimpleXMLElement $cssXml){
		$css = '';
		foreach($cssXml as $nodeType => $node){
			switch($nodeType){
				case 'comment':
					$css .= '/* ' . $node . ' */' . "\n";
				break;
				case 'ruleset':
					foreach($node->selector as $selector){
						$css .= $selector . ', ';
					}
					$css = substr($css, 0, -2);
					$css .= '{' . "\n";
					foreach($node->property as $property){
						$css .= "\t" . $property['type'] . ': ' . $property . ';' . "\n";
					}
					$css .= '}' . "\n";
				break;				
			}
			
			
			//var_dump($key, $value);
		}
		return $css;
	}
	
}